#ifndef _MY_DISPLAY_ENV_H_
#define _MY_DISPLAY_ENV_H_

#include "../include/unicom.h"

/*
 *网页显示环境信息的共享内存结构
 **/
struct storage_goods_info
{
	unsigned char goods_type;
	unsigned int goods_count;
};

struct storage_info
{
	unsigned char storage_status; // 0:open 1:close
	unsigned char led_status;
	unsigned char buzzer_status;
	unsigned char fan_status;
	unsigned char seg_status;
	signed char x;
	signed char y;
	signed char z;
	char samplingTime[20];
	float temperature;
	float temperatureMIN;
	float temperatureMAX;
	float humidity;
	float humidityMIN;
	float humidityMAX;
	float illumination;
	float illuminationMIN;
	float illuminationMAX;
	float battery;
	float adc;
	float adcMIN;
	struct storage_goods_info goods_info[GOODS_NUM];
};

struct env_info_clien_addr
{
	struct storage_info storage_no[STORAGE_NUM];
};
struct shm_addr
{
	char cgi_status;
	char qt_status;
	struct env_info_clien_addr rt_status;
};

/*
 *仓库1环境的网页显示，共享内存实现，数据流向:main从串口获取Zigbee数据，写到共享内存
 *环境网页显示共享内存的信息
 **/
int init_shm(struct ipc_info *p_ipc_info);
void show_env2web(struct ipc_info *p_ipc_info, struct sendEnv *house_env);

#endif